package com.ricchieri.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Inheritance(strategy=InheritanceType.JOINED)
@Table(name="operation")
public class Operation extends BaseEntity {
	private static final long serialVersionUID = 2656676559596033071L;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user", nullable = false)
	private User user;
	
	@Column(name="operationDate", nullable=false)
	private Date operationDate;
	
	@Column(name="automatic", nullable=false)
	private Boolean automatic;
	
	@Column(name="operationType", nullable=false, length=1)
	private String operationType;	
	
	@Column(name="amount", nullable=false)
	private Double amount;
	
	@Column(name="observation", nullable=true, length=500)
	private String observation;
		
	public User getUser() {
		return user;
	}
	
	public void setUser(User user) {
		this.user = user;
	}
	
	public Date getOperationDate() {
		return operationDate;
	}
	
	public void setOperationDate(Date operationDate) {
		this.operationDate = operationDate;
	}
	
	public Boolean getAutomatic() {
		return automatic;
	}
	
	public void setAutomatic(Boolean automatic) {
		this.automatic = automatic;
	}
	
	public String getOperationType() {
		return operationType;
	}
	
	public void setOperationType(String operationType) {
		this.operationType = operationType;
	}	
	
	public Double getAmount() {
		return amount;
	}
	
	public void setAmount(Double amount) {
		this.amount = amount;
	}
	
	public String getObservation() {
		return observation;
	}
	
	public void setObservation(String observation) {
		this.observation = observation;
	}
}